<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>JVM: Referência ao ficheiro src/classfile.h</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Gerado por Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Página&nbsp;principal</span></a></li>
      <li class="current"><a href="files.html"><span>Ficheiros</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Referência ao ficheiro src/classfile.h</h1><hr><a name="_details"></a><h2>Descrição detalhada</h2>
Funções para leitura e impressão do .class e conversão para big-endian. 
<p>

<p>Definido no ficheiro <a class="el" href="classfile_8h-source.html">classfile.h</a>.</p>

<p>
<code>#include &quot;<a class="el" href="common_8h-source.html">common.h</a>&quot;</code><br>

<p>
<a href="classfile_8h-source.html">Ir para o código fonte deste ficheiro.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Macros</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="324523ffaae4bda020354153ae8f195e"></a><!-- doxytag: member="classfile.h::SWAP_2" ref="324523ffaae4bda020354153ae8f195e" args="(x)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#324523ffaae4bda020354153ae8f195e">SWAP_2</a>(x)&nbsp;&nbsp;&nbsp;( (((x) &amp; 0xff) &lt;&lt; 8) | ((unsigned short)(x) &gt;&gt; 8) )</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Altera a ordem de 2 bytes : xy -&gt; yx. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#9b1f0991c3a3f2785bf2f7d0ca05d955">SWAP_4</a>(x)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">altera a ordem de 4 bytes : xywz -&gt; zwyx  <a href="#9b1f0991c3a3f2785bf2f7d0ca05d955"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="610ef0c32d3ab57f2e68a8adb274a1ad"></a><!-- doxytag: member="classfile.h::FIX_2" ref="610ef0c32d3ab57f2e68a8adb274a1ad" args="(x)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#610ef0c32d3ab57f2e68a8adb274a1ad">FIX_2</a>(x)&nbsp;&nbsp;&nbsp;(*(unsigned short *)&amp;(x) = SWAP_2(*(unsigned short *)&amp;(x)))</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converte 2 bytes de little-endian para big-endian. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2fe05b3a338cd7d0497ab99d19a21405"></a><!-- doxytag: member="classfile.h::FIX_4" ref="2fe05b3a338cd7d0497ab99d19a21405" args="(x)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#2fe05b3a338cd7d0497ab99d19a21405">FIX_4</a>(x)&nbsp;&nbsp;&nbsp;(*(unsigned int *)&amp;(x)   = SWAP_4(*(unsigned int *)&amp;(x)))</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converte 4 bytes de little-endian para big-endian. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cee1c5a539f26dc46489882af26eb6d5"></a><!-- doxytag: member="classfile.h::CP_INFO" ref="cee1c5a539f26dc46489882af26eb6d5" args="(i)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#cee1c5a539f26dc46489882af26eb6d5">CP_INFO</a>(i)&nbsp;&nbsp;&nbsp;constant_pool[(i)].info</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Utilizado apenas para legibilidade e facilidade de escrita. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cee1c5a539f26dc46489882af26eb6d5"></a><!-- doxytag: member="classfile.h::CP_INFO" ref="cee1c5a539f26dc46489882af26eb6d5" args="(i)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#cee1c5a539f26dc46489882af26eb6d5">CP_INFO</a>(i)&nbsp;&nbsp;&nbsp;constant_pool[(i)].info</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Utilizado apenas para legibilidade e facilidade de escrita. <br></td></tr>
<tr><td colspan="2"><br><h2>Funções</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#e2905f7838f9545714c0135417642730">loadClass</a> (char *class_name)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Carrega a classe.  <a href="#e2905f7838f9545714c0135417642730"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8735aa89e388b7eb0b951c5796b56bf9"></a><!-- doxytag: member="classfile.h::get_class" ref="8735aa89e388b7eb0b951c5796b56bf9" args="(class_list *l, char *class_name)" -->
class_file *&nbsp;</td><td class="memItemRight" valign="bottom"><b>get_class</b> (class_list *l, char *class_name)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#b02d2ff95ffa15a5beb3f27341e1bd3c">printclass</a> (class_file *in)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Imprime a classe.  <a href="#b02d2ff95ffa15a5beb3f27341e1bd3c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">method_info *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#3c358c44a574868a7c3fbce9452c16a2">get_method</a> (char *method_name)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Procura um método.  <a href="#3c358c44a574868a7c3fbce9452c16a2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="common_8h.html#e5be1f726785414dd1b77d60df074c9d">u4</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfile_8h.html#82dcfcb11bdaa1f4a0f91d4d051267c7">get_method_index</a> (char *method_name)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Informa o índice do método no constant pool.  <a href="#82dcfcb11bdaa1f4a0f91d4d051267c7"></a><br></td></tr>
</table>
<hr><h2>Documentação das macros</h2>
<a class="anchor" name="9b1f0991c3a3f2785bf2f7d0ca05d955"></a><!-- doxytag: member="classfile.h::SWAP_4" ref="9b1f0991c3a3f2785bf2f7d0ca05d955" args="(x)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SWAP_4          </td>
          <td>(</td>
          <td class="paramtype">x&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Valor:</b><div class="fragment"><pre class="fragment">( ((x) &lt;&lt; 24) | \
         (((x) &lt;&lt; 8) &amp; 0x00ff0000) | \
         (((x) &gt;&gt; 8) &amp; 0x0000ff00) | \
         ((x) &gt;&gt; 24) )
</pre></div>altera a ordem de 4 bytes : xywz -&gt; zwyx 
<p>

<p>Definido na linha <a class="el" href="classfile_8h-source.html#l00015">15</a> do ficheiro <a class="el" href="classfile_8h-source.html">classfile.h</a>.</p>

</div>
</div><p>
<hr><h2>Documentação das funções</h2>
<a class="anchor" name="3c358c44a574868a7c3fbce9452c16a2"></a><!-- doxytag: member="classfile.h::get_method" ref="3c358c44a574868a7c3fbce9452c16a2" args="(char *method_name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">method_info* get_method           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>method_name</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Procura um método. 
<p>
<dl compact><dt><b>Parâmetros:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>method_name</em>&nbsp;</td><td>Nome do método </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Retorna:</b></dt><dd>As informações do método </dd></dl>

</div>
</div><p>
<a class="anchor" name="82dcfcb11bdaa1f4a0f91d4d051267c7"></a><!-- doxytag: member="classfile.h::get_method_index" ref="82dcfcb11bdaa1f4a0f91d4d051267c7" args="(char *method_name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="common_8h.html#e5be1f726785414dd1b77d60df074c9d">u4</a> get_method_index           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>method_name</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Informa o índice do método no constant pool. 
<p>
<dl compact><dt><b>Parâmetros:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>method_name</em>&nbsp;</td><td>Nome do método </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Retorna:</b></dt><dd>O índice </dd></dl>

</div>
</div><p>
<a class="anchor" name="e2905f7838f9545714c0135417642730"></a><!-- doxytag: member="classfile.h::loadClass" ref="e2905f7838f9545714c0135417642730" args="(char *class_name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void loadClass           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>class_name</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Carrega a classe. 
<p>
<dl compact><dt><b>Parâmetros:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>class_name</em>&nbsp;</td><td>Nome da classe </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="b02d2ff95ffa15a5beb3f27341e1bd3c"></a><!-- doxytag: member="classfile.h::printclass" ref="b02d2ff95ffa15a5beb3f27341e1bd3c" args="(class_file *in)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void printclass           </td>
          <td>(</td>
          <td class="paramtype">class_file *&nbsp;</td>
          <td class="paramname"> <em>in</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Imprime a classe. 
<p>
<dl compact><dt><b>Parâmetros:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>in</em>&nbsp;</td><td>O arquivo .class </td></tr>
  </table>
</dl>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Gerado em Wed Jul 1 15:56:08 2009 para JVM por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>
